use fastrand::Rng;
use std::io::stdin;

fn main() {/* used */
    let mut rng = Rng::new();
    let secret = rng.i32(1..101);
    println!("Guess the number!");
    loop {
        let mut guess = String::new();
        stdin().read_line(&mut guess).expect("Failed to read line");
        let guess_num = guess.trim().parse::<i32>().unwrap();
        if guess_num == secret {
            println!("You win!");
            break;
        } else if guess_num > secret {
            println!("Too big!");
        } else {
            println!("Too small!");
        }
    }
}
